<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>SYS_FS_FUNCTIONS Structure</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

<script type="text/javascript" src="scripts.js"></script>
</head>
<body class="Element700" onload="onBodyLoadEx('frames.html', 'topic', '01012.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->

<!-- End Popups -->

<!-- Begin Page Header -->
<div class="Element710" id="areafixed">
<div class="Element94">
<a href="01259.html" target="topic">System Service Libraries Help</a> &gt; <a href="00735.html" target="topic">File System Service Library Help</a> &gt; <a href="00736.html" target="topic">Library Interface</a> &gt; d) File System Data Types and Constants &gt; <a href="01012.html" target="topic">SYS_FS_FUNCTIONS Structure</a></div>
<div class="Element92">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="25%">
<div class="Element1">
MPLAB Harmony Core Help</div>
</td><td width="25%">
<div class="Element2">
<a href="contents.html" target="tocidx">Contents</a> | <a href="00007.html" target="topic">Home</a></div>
</td><td width="25%">
<div class="Element90">
<a href="01003.html" target="topic">Previous</a> | <a href="00736.html" target="topic">Up</a> | <a href="01118.html" target="topic">Next</a></div>
</td><td width="25%">
<div class="Element96">
<a href="mailto:docerrors@microchip.com&subject=MPLAB Harmony Documentation Feedback (Topic ID: SYS_FS_FUNCTIONS Topic Title: SYS_FS_FUNCTIONS Structure)&body=Thank you for your feedback! Please include a description of your feedback, and indicate whether you are reporting an an error in the documentation or an enhancement.">Documentation Feedback</a><br> <a href="http://support.microchip.com" target="_blank">Microchip Support</a></div>
</td></tr></table><div class="Element5">
SYS_FS_FUNCTIONS Structure</div>
</div>
</div>

<!-- End Page Header -->

<!-- Begin Client Area -->
<div class="Element720" id="areascroll">
<div class="Element721">

<!-- Begin Page Content -->
<a name="PageContent"></a><div class="Element58">
<a name="4465736372697074696F6E"></a><div class="Element11">
<div class="Element10">
<p class="Element10">
SYS FS Function signature structure for native file systems&nbsp;</p>
<p class="Element10">
The SYS FS layer supports functions from each native file system layer. This structure specifies the signature for each function from native file system (parameter that needs to be passed to each function and return type for each function). If a new native file system is to be integrated with the SYS FS layer, the functions should follow the signature.&nbsp;</p>
<p class="Element10">
The structure of function pointer for the two native file systems: FAT FS and MPFS2 is already provided in the respective source files for the native file system. Hence the following structure is not immediately useful for the user. But the explanation for the structure is still provided for advanced users who would wish to integrate a new native file system to the MPLAB Harmony File System framework.</p></div>
</div>
<a name="43"></a><div class="Element99">
C</div>
<div class="Element101"><div class="Element100"><pre class="Element100"><strong><span style="color: #000080">typedef</span></strong> <strong><span style="color: #000080">struct</span></strong> {
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">mount</span></strong>)(uint8_t vol);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">unmount</span></strong>)(uint8_t vol);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">open</span></strong>)(uintptr_t handle, <strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong>* path, uint8_t mode);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">read</span></strong>)(uintptr_t fp, <strong><span style="color: #000080">void</span></strong>* buff, uint32_t btr, uint32_t *br);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">write</span></strong>)(uintptr_t fp, <strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">void</span></strong>* buff, uint32_t btw, uint32_t* bw);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">close</span></strong>)(uintptr_t fp);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">seek</span></strong>)(uintptr_t handle, uint32_t offset);
  uint32_t (* <strong><span style="color: #000000">tell</span></strong>)(uintptr_t handle);
  <strong><span style="color: #000080">bool</span></strong> (* <strong><span style="color: #000000">eof</span></strong>)(uintptr_t handle);
  uint32_t (* <strong><span style="color: #000000">size</span></strong>)(uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">fstat</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong>* path, uintptr_t fno);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">mkdir</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *path);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">chdir</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *path);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">remove</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *path);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">getlabel</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *path, <strong><span style="color: #000080">char</span></strong> *buff, uint32_t *sn);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">setlabel</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *label);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">truncate</span></strong>)(uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">currWD</span></strong>)(<strong><span style="color: #000080">char</span></strong>* buff, uint32_t len);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">chdrive</span></strong>)(uint8_t drive);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">chmode</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong>* path, uint8_t attr, uint8_t mask);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">chtime</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong>* path, uintptr_t ptr);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">rename</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *oldPath, <strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *newPath);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">sync</span></strong>)(uintptr_t fp);
  <strong><span style="color: #000080">char</span></strong> * (* <strong><span style="color: #000000">getstrn</span></strong>)(<strong><span style="color: #000080">char</span></strong>* buff, <strong><span style="color: #000080">int</span></strong> len, uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">putchr</span></strong>)(<strong><span style="color: #000080">char</span></strong> c, uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">putstrn</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong>* str, uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">formattedprint</span></strong>)(uintptr_t handle, <strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *str, va_list argList);
  <strong><span style="color: #000080">bool</span></strong> (* <strong><span style="color: #000000">testerror</span></strong>)(uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">formatDisk</span></strong>)(uint8_t vol, <strong><span style="color: #000080">const</span></strong> <a href="00996.html" target="topic">SYS_FS_FORMAT_PARAM</a>* opt, <strong><span style="color: #000080">void</span></strong>* work, uint32_t len);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">readDir</span></strong>)(uintptr_t handle, uintptr_t stat);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">closeDir</span></strong>)(uintptr_t handle);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">partitionDisk</span></strong>)(uint8_t pdrv, <strong><span style="color: #000080">const</span></strong> uint32_t szt[], <strong><span style="color: #000080">void</span></strong>* work);
  <strong><span style="color: #000080">int</span></strong> (* <strong><span style="color: #000000">getCluster</span></strong>)(<strong><span style="color: #000080">const</span></strong> <strong><span style="color: #000080">char</span></strong> *path, uint32_t *tot_sec, uint32_t *free_sec);
} SYS_FS_FUNCTIONS;</pre></div></div>
<a name="4D656D62657273"></a><div class="Element14">
Members</div>
<div class="Element11">
<div class="Element10">
<div class="Element272">
<div class="TableDiv">
<table cellspacing="0" class="Table1">
<tr>
<td class="Element260" valign="top" width="35%">
<div class="Element261">
Members&nbsp;</div></td><td class="Element264" valign="top" width="65%">
<div class="Element265">
Description&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* mount)(uint8_t vol);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for mounting a volume&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* unmount)(uint8_t vol);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for unmounting a volume&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* open)(uintptr_t handle, const char* path, uint8_t mode);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for opening a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* read)(uintptr_t fp, void* buff, uint32_t btr, uint32_t *br);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for reading a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* write)(uintptr_t fp, const void* buff, uint32_t btw, uint32_t* bw);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for writing to a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* close)(uintptr_t fp);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for closing a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* seek)(uintptr_t handle, uint32_t offset);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for moving the file pointer by a</p>
<ul class="Element630">
<li class="Element600">desired offset</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
uint32_t (* tell)(uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system for finding the position of the</p>
<ul class="Element630">
<li class="Element600">file pointer</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
bool (* eof)(uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to check if the end of file is</p>
<ul class="Element630">
<li class="Element600">reached</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
uint32_t (* size)(uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to know the size of file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* fstat)(const char* path, uintptr_t fno);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to know the status of file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* mkdir)(const char *path);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to create a directory&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* chdir)(const char *path);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to change a directory&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* remove)(const char *path);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to remove a file or directory&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* getlabel)(const char *path, char *buff, uint32_t *sn);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to get the volume label&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* setlabel)(const char *label);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to set the volume label&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* truncate)(uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to truncate the file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* currWD)(char* buff, uint32_t len);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to obtain the current working</p>
<ul class="Element630">
<li class="Element600">directory</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* chdrive)(uint8_t drive);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to set the current drive&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* chmode)(const char* path, uint8_t attr, uint8_t mask);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to change the attribute for file</p>
<ul class="Element630">
<li class="Element600">or directory</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* chtime)(const char* path, uintptr_t ptr);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to change the time for a file or</p>
<ul class="Element630">
<li class="Element600">directory</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* rename)(const char *oldPath, const char *newPath);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to rename a file or directory&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* sync)(uintptr_t fp);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to flush file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
char * (* getstrn)(char* buff, int len, uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to read a string from a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* putchr)(char c, uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to write a character into a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* putstrn)(const char* str, uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to write a string into a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* formattedprint)(uintptr_t handle, const char *str, va_list argList);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to print a formatted string to</p>
<ul class="Element630">
<li class="Element600">file</li>
</ul><p class="Element267">
&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
bool (* testerror)(uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to test an error in a file&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* formatDisk)(uint8_t vol, const SYS_FS_FORMAT_PARAM* opt, void* work, uint32_t len);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to format a disk&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* readDir)(uintptr_t handle, uintptr_t stat);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to read a directory&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* closeDir)(uintptr_t handle);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to close an opened directory&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* partitionDisk)(uint8_t pdrv, const uint32_t szt[], void* work);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to partition a physical drive&nbsp;</div></td></tr><tr>
<td class="Element262" valign="top" width="35%">
<div class="Element263">
int (* getCluster)(const char *path, uint32_t *tot_sec, uint32_t *free_sec);&nbsp;</div></td><td class="Element266" valign="top" width="65%">
<div class="Element267">
Function pointer of native file system to get total sectors and free</p>
<ul class="Element630">
<li class="Element600">sectors</li>
</ul><p class="Element267">
&nbsp;</div></td></tr></table></div></div>
</div>
</div>
<a name="52656D61726B73"></a><div class="Element14">
Remarks</div>
<div class="Element11">
<div class="Element10">
<p class="Element10">
None.</p></div>
</div>
</div>
<!-- End Page Content -->

<!-- Begin Page Footer -->
<div class="Element95">
<a href="01259.html" target="topic">System Service Libraries Help</a> &gt; <a href="00735.html" target="topic">File System Service Library Help</a> &gt; <a href="00736.html" target="topic">Library Interface</a> &gt; d) File System Data Types and Constants &gt; <a href="01012.html" target="topic">SYS_FS_FUNCTIONS Structure</a></div>
<div class="Element93">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="25%">
<div class="Element3">
MPLAB Harmony Core Help</div>
</td><td width="25%">
<div class="Element4">
<a href="contents.html" target="tocidx">Contents</a> | <a href="00007.html" target="topic">Home</a></div>
</td><td width="25%">
<div class="Element91">
<a href="01003.html" target="topic">Previous</a> | <a href="00736.html" target="topic">Up</a> | <a href="01118.html" target="topic">Next</a></div>
</td><td width="25%">
<div class="Element97">
<a href="mailto:docerrors@microchip.com&subject=MPLAB Harmony Documentation Feedback (Topic ID: SYS_FS_FUNCTIONS Topic Title: SYS_FS_FUNCTIONS Structure)&body=Thank you for your feedback! Please include a description of your feedback, and indicate whether you are reporting an an error in the documentation or an enhancement.">Documentation Feedback</a><br> <a href="http://support.microchip.com" target="_blank">Microchip Support</a></div>
</td></tr></table></div>

<!-- End Page Footer -->
</div>
</div>

<!-- End Client Area -->
</body></html>